import { createRouter, createWebHistory } from 'vue-router'


const routes = [
  {
    path: '',
    redirect:'/login'
  },
  {
    path: '/login',
    component:()=> import('../views/login/login')
  },
  {
    path: '/home',
    component:()=> import('../views/home/index'),
    children:[
      {
        path:'',
        redirect:'/home/main'
      },
      {
        path:'main',
        component:()=>import('../views/main/index')
      },
      {
        path:'user',
        component:()=> import('../views/user/index')
      },
      {
        path: 'checkCar',
        component:import('../views/checkCar/index')
      },
      {
        path: 'order',
        component:import('../views/order/index')
      }
    ]
  }


]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
